package com.ocom.payconfig.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ocom.common.entity.card.EntityConsTypeConfig;
import com.ocom.common.response.web.GetConsTypeResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IDaoConsTypeConfig extends BaseMapper<EntityConsTypeConfig> {


    @Select({"<script>","SELECT\n" +
            "\tC.cons_name,C.sub_account,C.cons_type AS consType,\n" +
            "\tC.cons_name AS consTypeName,\n" +
            "\tC.sub_account AS subAccountNo,\n" +
            "\tC.wallet_serial AS walletSerial,\n" +
            "\tC.withhold_serial AS withholdSerial,\n" +
            "\tA.sub_account_name AS subAccountName\n" +
            "FROM\n" +
            "\tcons_type_config AS C\n" +
            "LEFT JOIN xf_sub_account AS A ON A.com_id = C.com_id\n" +
            "AND A.sub_account = C.sub_account\n" +
            "WHERE\n" +
            "\tC.com_id = #{comId}\n" +
            "ORDER BY\n" +
            "\tC.cons_type","</script>"})
    List<GetConsTypeResponse> getConsType(Long comId);
}
